package com.waitingresult.designpattern.behavioral.strategy.enums;

import lombok.Getter;

/**
 * All right reserved,Designed By WangShuai
 *
 * @author : WangShuai
 * @version : V1.0
 * @ClassName : StrategyEnum02
 * @Description :
 * @date : 2022/9/15 21:38
 */
@Getter
public enum StrategyEnum02 implements BizStrategy{
    One("One"){
        @Override
        public void sout() {
            System.err.println("One");
        }
    },
    Tow("Tow"){
        @Override
        public void sout() {
            System.err.println("Tow");
        }
    };
    private String name;

    StrategyEnum02(String name) {
        this.name = name;
    }

    public static StrategyEnum02 getEnum(String name){
        for (StrategyEnum02 value : StrategyEnum02.values()) {
            if(value.getName().equals(name)){
                return value;
            }
        }
        return null;
    }

}
